#ifndef GE_SINGLETON_H
#define GE_SINGLETON_H

template <typename T>
class Singleton
{
protected:
	Singleton ()  {}
	~Singleton () {}

public:
	// Interface publique
	static T* get()
	{
		if (!m_singleton)
		{
			m_singleton = new T;
		}
		return m_singleton;
	}

	static void kill()
	{
		if (m_singleton)
		{
			delete m_singleton;
			m_singleton = 0;
		}
	}

private:
	static T* m_singleton;
};

template <typename T>
T* Singleton<T>::m_singleton = 0;

#endif // GE_SINGLETON_H
